//登录
function $(id){
	return document.getElementById(id);
}
function checkLogin() {
    var username = $("#username").val();
    var password = $("#password").val();
    var msg = document.getElementById('msg');
    var usernameInp = document.getElementById('username');
    var passwordInp = document.getElementById('password');
//    alert("username="+username);
//    alert("password="+password);
    if(username.length == 0){
        msg.innerHTML = "账号不能为空！";
        usernameInp.focus();
        return false;
    }
    if(username.length>12){
    	msg.innerHTML = "账号不能超过12个字符！";
    	usernameInp.focus();
    	return false;
    }
	if(password.length ==0){
		msg.innerHTML = "密码不能为空！";
		passwordInp.focus();
		return false;
     }
     if(password.length>12){
    	 msg.innerHTML = "密码不能超过12个字符！";
    	 passwordInp.focus();
    	 return false;
     }
        console.log("信息格式正确！");
        msg.innerHTML ="";
        var json = {
        		instruct:"userLogin",
        		uname:username,
        		password:password
        }
        goAjax(json);
        return true;
     }

	